import {request} from '@/network/request'

//多条件查询知识产权
export function getKnowledgeByKey(property){
  return request({
    url:'/api/admin/getKnowledgeByKey',
    method:'post',
    data:{
      kn_id: property.kn_id==''?-1:property.kn_id,
      kn_name: property.kn_name,
      ser_id: property.ser_id==''?-1:property.ser_id,
      kn_kind: property.kn_kind,
      kn_type: property.kn_type
    }
  })
}

//新建知识产权
export function insertKnowledge(property){
  return request({
    url:'/api/admin/insertKnowledge',
    method:'post',
    data:{
      kn_id: property.kn_id,
      kn_name: property.kn_name,
      ser_id: property.ser_id,
      kn_price: parseFloat(property.kn_price),
      // kn_kind: property.kn_kind,
      kn_type: property.kn_type
    }
  })
}

//更新知识产权
export function updateKnowledge(property){
  return request({
    url:'/api/admin/updateKnowledge',
    method:'post',
    data:{
      kn_id: property.kn_id,
      kn_name: property.kn_name,
      ser_id: property.ser_id,
      kn_price: parseFloat(property.kn_price),
      // kn_kind: property.kn_kind,
      kn_type: property.kn_type
    }
  })
}

//删除知识产权
export function deleteKnowledge(id){
  return request({
    url:'/api/admin/deleteKnowledge',
    method:'get',
    params:{id}
  })
}

//更新知识产权状态
export function updateKnowledgeType(id){
  return request({
    url:"/api/admin/updateKnowledgeType",
    method:'get',
    params:{id}
  })
}

